Skip to main content

All Questions

-2votes
1answer
796views

Refactoring nested if-else interface method in Java8

I have the below default method in an interface and it seems to be pretty complex because of the many if-else conditions. default void validate() { Application application = application().get(); ...
AnOldSoul's user avatar
3votes
2answers
233views

Refactoring wordy conditional tests [duplicate]

My first attempt at this question was too theoretical, so I've rewritten it with actual code. See the edit history if you care. Supposing this logic, "suffering" from the arrow anti-pattern: /** * ...
bishop's user avatar
-2votes
3answers
361views

Should I use AND or should I use OR [closed]

An order can be in the "status" of Completed, Corrected or some other status. I saw some code that is checking it like this, the purpose is to disable some stuff when the status is in Completed or ...
Blake's user avatar
56votes
11answers
154kviews

How would you refactor nested IF Statements? [duplicate]

I was cruising around the programming blogosphere when I happened upon this post about GOTO's: http://giuliozambon.blogspot.com/2010/12/programmers-tabu.html Here the writer talks about how "one ...
saunderl's user avatar

close